(() => {
    document.querySelectorAll('.gd-popover').forEach(item => {
        let content = item.getAttribute('content')
        if(content) {
            let dom = document.createElement('div')
            let domClass = 'gd-popover__inner'
            let placement = item.getAttribute('placement')
            if(placement && placement === 'right') {
                domClass += ' gd-popover-' + placement
            }
            dom.className = domClass
            dom.innerHTML = content
            item.appendChild(dom)
            item.addEventListener('mouseover', () => {
                dom.show()
            })
            item.addEventListener('mouseout', () => {
                dom.hide()
            })
        }
    })
})()